Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export offsets necessary for external codegen #49548

Merged
merged 1 commit into from
Apr 29, 2023
Merged

Conversation

vchuravy
Copy link
Sponsor Member

Enzyme performs external codegen that needs to access current_task and
the ptls. We have three options:

  1. Hard-code it per Julia version/architecture
  2. "Introspect" it by doing a code_llvm to get the offset
  3. Expose a variable that Enzyme can read to get a stable answer.

We used to do 1. in the past which lead to fun crashes everytime it changed on the
Julia side.

We currently do 2., which leads to bad initialization times.

This is option 3.

@gbaraldi
Copy link
Member

Is int fine here or should this be a ptrdiff_t?

@vchuravy
Copy link
Sponsor Member Author

Int should be fine. these are between 12-14

@vchuravy vchuravy requested a review from vtjnash April 27, 2023 23:00
src/init.c Show resolved Hide resolved
@vchuravy vchuravy merged commit faced27 into master Apr 29, 2023
@vchuravy vchuravy deleted the vc/task_offset branch April 29, 2023 23:14
@vchuravy vchuravy added the backport 1.9 Change should be backported to release-1.9 label May 2, 2023
@KristofferC KristofferC mentioned this pull request May 8, 2023
51 tasks
KristofferC pushed a commit that referenced this pull request May 8, 2023
KristofferC pushed a commit that referenced this pull request May 8, 2023
KristofferC pushed a commit that referenced this pull request May 27, 2023
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label May 28, 2023
kpamnany pushed a commit that referenced this pull request Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants